const defaultOptions = {
  selector: '#poster',
};

function Poster(options = {}, $scope) {
  options = {
    ...defaultOptions,
    ...options,
  };

  // const pages = getCurrentPages();
  // const ctx = pages[pages.length - 1];

  const poster = $scope;
  delete options.selector;

  return poster;
}

Poster.create = (reset = false, $scope) => {
  const poster = Poster({}, $scope);
  if (!poster) {
    console.error('请设置组件的id="poster"!!!');
  } else {
    return poster.onCreate(reset);
  }
};

export default Poster;
